#ifndef  EVENTFD_H
#define  EVENTFD_H
#include <functional>
namespace moqi
{

using  EventCallback = std::function<void()>;

class Eventfd
{
public:
    Eventfd(EventCallback &&cb);
    ~Eventfd();
    void start();
    void stop();
    void wakeup();
private:
    int createEventfd();
    void handlReadEvent();

private:
    int _evenfd;
    bool _isRunning;
    EventCallback _cb;
    


};
}//end of namespace moqi
 
#endif
